home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / editor / auror300.zip / DRAWBOX.AML < prev    next >
Text File  |  1996-07-17  |  2KB  |  78 lines

  1. //--------------------------------------------------------------------
  2. // DRAWBOX.AML
  3. // Draw a Box, (C) 1993-1996 by nuText Systems
  4. //
  5. // This macro draws a box around a column mark in the current edit
  6. // window. The current Line Style (on the edit window Set menu) is used
  7. // to draw the box.
  8. //
  9. // Usage:
  10. //
  11. // Select this macro from the Macro List (on the Macro menu), or run it
  12. // from the macro picklist <shift f12>.
  13. //--------------------------------------------------------------------
  14.  
  15. // compile time macros and function definitions
  16. include  bootpath "define.aml"
  17.  
  18. // test for edit windows
  19. if not wintype? "edit" then
  20.   msgbox "Edit windows only!"
  21.   return
  22. end
  23.  
  24. // test for mark in current window and column mark
  25. if getcurrbuf <> getmarkbuf or getmarktype <> 'k' then
  26.   msgbox "Column block not marked in current window"
  27.   return
  28. end
  29.  
  30. // get the box style from the _LineStyle variable
  31. style = "─│┌┐┘└═│╒╕╛╘─║╓╖╜╙═║╔╗╝╚      ▒▒▒▒▒▒" [_LineStyle * 6 + 1 : 6]
  32.  
  33. topside = getmarktop
  34. botside = getmarkbot
  35. leftside = getmarkleft
  36. rightside = getmarkright
  37.  
  38. undobegin
  39. oldmark = usemark 'T'
  40.  
  41. // right side
  42. column = rightside + 1
  43. markcolumn column column topside botside
  44. fillblock style [2]
  45.  
  46. // left side
  47. if leftside > 1 then
  48.   column = leftside - 1
  49.   markcolumn column column topside botside
  50.   fillblock style [2]
  51.   left_ok = 1
  52. end
  53.  
  54. destroymark
  55. usemark oldmark
  56.  
  57. // top side
  58. if topside > 1 then
  59.   topside = topside - 1
  60.   ovltext '':getmarkcols:style [1] leftside topside
  61.   ovltext style [4] rightside + 1 topside
  62.   if left_ok then
  63.     ovltext style [3] leftside - 1 topside
  64.   end
  65. end
  66.  
  67. // bottom side
  68. if botside < getlines then
  69.   botside = botside + 1
  70.   ovltext '':getmarkcols:style [1] leftside botside
  71.   ovltext style [5] rightside + 1 botside
  72.   if left_ok then
  73.     ovltext style [6] leftside - 1 botside
  74.   end
  75. end
  76.  
  77. undoend
  78.